package mpcs.view.components
{
	import spark.components.Button;
	import spark.primitives.BitmapImage;
	
	[Style(name="startIcon", type="Class")]
	public class StartButton extends Button {
		
		[SkinPart(required="false")]
		public var iconHolder:BitmapImage;
		
		public function StartButton() {
			super();
		}
		
		override protected function partAdded(partName:String, instance:Object) : void {
			
			super.partAdded(partName, instance);
			
			if ( partName == "iconHolder" ) {
				var iconClass:Class = Class(getStyle("startIcon"));
				if ( iconClass == null ) {
					instance = null;
				}else{
					BitmapImage(instance).source = new iconClass();
				}
			}
		}
		
		
	}
}